package so.sao.shop.supplier.dao.account;

import org.apache.ibatis.annotations.Param;
import so.sao.shop.supplier.domain.User;
import so.sao.shop.supplier.domain.account.AfterSetting;
/**
 * <p>Version: supplier V1.2.0 </p>
 * <p>Title: AfterSetting</p>
 * <p>Description: 供应商售后设置</p>
 *
 * @author: cris
 * @Date: Created in 2017/11/22 10:05
 */
public interface AfterSettingDao {
    int deleteByPrimaryKey(Long id);

    int insert(AfterSetting record);

    int insertSelective(AfterSetting record);

    AfterSetting selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AfterSetting record);

    int updateByPrimaryKeyWithBLOBs(AfterSetting record);

    int updateByPrimaryKey(AfterSetting record);

    /**
     * 根据登陆用户id或父id查询供应商售后设置
     * @param userId 用户id
     * @param parentId 父id
     * @return 售后设置
     */
    AfterSetting findByUserIdOrParentId(@Param("userId") Long userId, @Param("parentId") Long parentId);

    /**
     * B 端用：根据登陆用户accountId查询ParentId 和 userId
     * @param accountId
     * @return
     */
    User findParentIdAndUserIdByAccountId(@Param("accountId") Long accountId );

}